using System;
using System.IO;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using ClickSocial.Framework;
using ClickSocial.Components;
using ClickSocial.Entities;

namespace ClickSocial
{
    public partial class _Default : CDefault 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             Binding();
        }

        protected void Binding()
        {
            Paginador paginador = new Paginador(Request["page"], Request.Path, Request.QueryString);
            
            if (!string.IsNullOrEmpty(Request["list"]))
            {
                if (Request["list"] == "all")
                    paginador.PageDS.DataSource = Evento.GetAllOnlyPublics();

                if (Request["list"] == "des")
                    paginador.PageDS.DataSource = Destacados.GetAllPerm();
            }
            else
            {
                paginador.PageDS.DataSource = Destacados.GetAllPerm();
            }
            
            paginador.PageDS.AllowPaging = true;
            paginador.PageDS.PageSize = 6;
            litPaginador.Text = paginador.Render();

            DataListTopSite.DataSource = paginador.PageDS;
            DataListTopSite.DataBind();

        }

    }
}
